package com.maserb.monitor.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/** 
 * 规范词
 * 
 * @author jimmy
 */
@Entity
@Table(name = "sys_code")
public class SysCode extends BaseIdEntity {
	/**
	 * 代码
	 */
	private String code;
	/**
	 * 上级
	 */
	private SysCode parent;
	/**
	 * 代码类别
	 */
	private String codeSort;
	/**
	 * 名称
	 */
	private String name;
	/**
	 * 简称
	 */
	private String shortName;
	/**
	 * 是否加载到容器，等于Y则需要加载到容器
	 */
	private String loadContainer;
	/**
	 * 是否可选
	 */
	private String isEnable;
	/**
	 * 是否叶子节点
	 */
	@Transient
	private String isLeaf;
	/**
	 * 说明
	 */
	private String description;

	@Column(name = "node_code", length = 50)
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@ManyToOne
	@JoinColumn(name = "parent_id")
	@NotFound(action = NotFoundAction.IGNORE)
	public SysCode getParent() {
		return parent;
	}

	public void setParent(SysCode parent) {
		this.parent = parent;
	}

	@Column(name = "code_sort",length = 30)
	public String getCodeSort() {
		return codeSort;
	}

	public void setCodeSort(String codeSort) {
		this.codeSort = codeSort;
	}

	@Column(name = "node_name",length = 200)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "short_name",length = 200)
	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	@Column(name = "load_container",length = 1)
	public String getLoadContainer() {
		return loadContainer;
	}

	public void setLoadContainer(String loadContainer) {
		this.loadContainer = loadContainer;
	}

	@Column(name = "is_enable",length = 1)
	public String getIsEnable() {
		return isEnable;
	}

	public void setIsEnable(String isEnable) {
		this.isEnable = isEnable;
	}

	public String getIsLeaf() {
		return isLeaf;
	}

	public void setIsLeaf(String isLeaf) {
		this.isLeaf = isLeaf;
	}

	@Column(name = "description",length = 70)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}